from rest_framework.serializers import ModelSerializer

from education.models import Course, Comment, Teacher, Chapter


class CourseSerializer(ModelSerializer):

    class Meta:
        model = Course
        exclude = ('couid', )


class CourseSimpleSerializer(ModelSerializer):

    class Meta:
        model = Course
        fields = ('couname', 'image','price')

class CommentSerializer(ModelSerializer):

    class Meta:
        model = Comment
        exclude = ('course','user')

class TeacherSerializer(ModelSerializer):

    class Meta:
        model = Teacher
        exclude = ('course',)

class ChapterSerializer(ModelSerializer):

    class Meta:
        model = Chapter
        exclude = ('chaid','course')
# class TeacherSerializer(ModelSerializer):
#
#     class Meta:
#         model = Teacher
#         exclude = ('subject', )
